<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'listUser.jsp' starting page</title>
</head>

<body>
	<c:forEach items="${users}" var="u">
		
			<table>
			<tr>
				<td colspan="3">${u.username}</td>
			</tr>
			<tr>
				<td>关注：
					<a href="listUser?initiativeId=${u.userId}">
						${u.concernNum}
					</a>
				</td>
				<td>粉丝：
					<a href="listUser?passivityId=${u.userId}">
						${u.fansNum}
					</a>
				</td>
				<td>微博：
					<a href="listMicroblog?user.userId=${u.userId}">${u.microblogNum}</a>
				</td>
			</tr>
			<tr>
				<td colspan="3">
					<c:choose>
						<c:when test="${u.isAttent}">
							<c:if test="${u.isSelf == false}">
								<form action="deleteAttention" method="post">
									<input type="hidden" name="initiativeId" value="${user.userId}" />
									<input type="hidden" name="passivityId" value="${u.userId}" />
									<input type="submit" value="取消关注" />
								</form>
							</c:if>
						</c:when>
						<c:otherwise>
							<c:if test="${u.isSelf == false}">
								<form action="addAttention" method="post">
									<input type="hidden" name="initiativeId" value="${user.userId}" />
									<input type="hidden" name="passivityId" value="${u.userId}" />
									<input type="submit" value="关注" />
								</form>
							</c:if>
						</c:otherwise>
					</c:choose>
				</td>
			</tr>
		</table>
		<hr />
	</c:forEach>
</body>
</html>
